"(define (accumule combiner null-value term a next b)
    (if (> a b)
        null-value
        (combiner 
            (term a)
            (accumule combiner null-value term (next a) next b))))
"
(define (accumule combiner null-value term a next b)
    (define (iter a result)
        (if (> a b) result 
            (iter (next a) (combiner result (term a)))))
    (iter a null-value))

(define (sum term a next b)
    (accumule + 0 term a next b))

(define (sum-cubes a b)
    (define (cube-term i) (* i i i))
    (define (cube-next i) (+ i 1))
    (sum cube-term a cube-next b))

(define (product term a next b)
    (accumule * 1 term a next b))

(define (product-cubes a b)
    (define (cube-term i) (* i i i))
    (define (cube-next i) (+ i 1))
    (product cube-term a cube-next b))


    
